package com.aurora.supermarket.proxy;

import android.app.Application;
import com.aurora.supermarket.base.CallBack;

import java.util.Map;

/**
 * Created by Administrator on 2017/12/8.
 */

public class HttpProxy implements IHttpProxy {
    private static final HttpProxy ourInstance = new HttpProxy();
    private OKHttpProcess okHttpProcess;
    public static HttpProxy getInstance() {
        return ourInstance;
    }

    private HttpProxy() {
    }

    public void init(Application context){
        okHttpProcess = new OKHttpProcess(context);
    }

    @Override
    public void get(String url, Map<String, Object> params, CallBack<String> stringCallBack) {
        okHttpProcess.get(url,params,stringCallBack);
    }

    @Override
    public void post(String url, Map<String, Object> params, CallBack<String> stringCallBack) {
        okHttpProcess.post(url,params,stringCallBack);
    }
}
